package com.hzhjhh.view.manageView.menus.query.enums;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 菜单栏初始化-仓库-新增商品-展示字段映射enum
 * 
 * @author 12083
 *
 */
@Getter
@AllArgsConstructor
public enum QueryGoodsShowEnum {

	CODE("merchandiseTreatyCode", "商品编码"),
	TREATY_CODE("merchandiseTreatyCode", "条形码"),
	SORT_ID("merchandiseSortId", "类别编号"),
	NAME("merchandiseName", "商品名称"),
	RETAIL_PRICE("merchandiseRetailPrice", "零售价（元）"),
	SPEC("merchandiseSpec", "商品规格"),
	UNITS("merchandiseUnits", "计量单位"),
	PURCHASE_PRICE("merchandisePurchasePrice", "进货价"),
	CHECK_TERM("merchandiseCheckTerm", "保质期（天）"),
	REMARK("merchandiseRemark", "备注"),
	;
	
	/**
	 * 列对应的code
	 */
	private final String columnCode;
	/**
	 * 列展示时候的名称
	 */
	private final String columnName;
	
	public static Map<String, String> descMap() {
		return Arrays.asList(QueryGoodsShowEnum.values())
				.stream()
				.collect(Collectors.toMap(QueryGoodsShowEnum::getColumnName, QueryGoodsShowEnum::getColumnCode, (v1, v2) -> v1));
	}
	public static Map<String, String> toMap() {
		return Arrays.asList(QueryGoodsShowEnum.values())
				.stream()
				.collect(Collectors.toMap(QueryGoodsShowEnum::getColumnCode, QueryGoodsShowEnum::getColumnName, (v1, v2) -> v1));
	}
}
